<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		<title>修改文章</title>
		<style type="text/css">
			.checkbox {
				margin-left: 5px;
				width: 90px;
				margin-top: 10px;
			}
			textarea {
				width: 300px;
				height: 100px;
			}
		</style>
		<js file="__STATIC__/js/jq.js" />
		<js file="__STATIC__/js/bootstrap.js" />
		<css file="__STATIC__/css/bootstrap.css" />
		<script>
			$(function() {
				$('input[name=attr]').button('toggle');
			})
		</script>
		<script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor/ueditor.config.js"></script>
		<script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor/ueditor.all.min.js">
		</script>
		<script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor/lang/zh-cn/zh-cn.js"></script>
	</head>

	<body>
		<div class="wrap">
			<div class="hd-title-header">
				<h4>添加文章</h4>
			</div>
			<form action="__CONTROLLER__/update" method="post" class="form-inline" enctype="multipart/form-data">
				<table class="table table-striped table-hover">
					<tr>
						<th class="w100">文章标题</th>
						<td class="w100">
							<div class="form-group">
								<input type="hidden" name="aid"  value="{$artContent.aid}" />
								<input value="{$artContent.title}" type="text" name="title" class="form-control" />
							</div>
						</td>
						<td></td>
					</tr>
					<tr>
						<th class="w100">作者</th>
						<td>
							<input value="{$artContent.author}" type="text" name="author" class="form-control" value="" />
						</td>
						<td></td>
					</tr>
					<tr>
						<th class="w100">所属分类</th>
						<td>
							<select name="category_cid" class="w200">
								<option value="0">请选择分类</option>
								<foreach from="$treecates" key="$key" value="$val">
									<option value="{$val.cid}" <if value='$artContent.category_cid eq $val.cid'>selected="selected"</if>>{$val._name}</option>
								</foreach>
							</select>
						</td>
						<td></td>
					</tr>
					<tr>
						<th class="w100">文章摘要</th>
						<td>
							<textarea name="digest" class="form-control" id="" cols="50" rows="10">{$artContent.digest}</textarea>
						</td>
						<td></td>
					</tr>
					<tr>
						<th class="w100">缩略图</th>
						<td>
							<input type="file" name="thumb" />	路径:{$artContent.thumb}
						</td>
						<td></td>
					</tr>
					<tr>
						<th class="w100">文章属性</th>
						<td>
							<div class="btn-group" data-toggle="buttons">
								
								<label class="btn btn-primary <?php if(in_array('热门',$artContent['attr'])) echo 'active' ?>">
									<input name="attr[]" type="checkbox" value="热门" autocomplete="off" <?php if(in_array('热门',$artContent['attr'])) echo 'checked=checked' ?> >热门
								</label>
								<label class="btn btn-primary <?php if(in_array('置顶',$artContent['attr'])) echo 'active' ?> ">
									<input name="attr[]" type="checkbox" value="置顶" autocomplete="off" <?php if(in_array('置顶',$artContent['attr'])) echo 'checked=checked' ?> > 置顶
								</label>
								<label class="btn btn-primary <?php if(in_array('推荐',$artContent['attr'])) echo 'active' ?>">
									<input name="attr[]" type="checkbox" value="推荐" autocomplete="off"  <?php if(in_array('推荐',$artContent['attr'])) echo 'checked=checked' ?> > 推荐
								</label>
								<label class="btn btn-primary <?php if(in_array('图文',$artContent['attr'])) echo 'active' ?>">
									<input name="attr[]" type="checkbox" value="图文" autocomplete="off"  <?php if(in_array('图文',$artContent['attr'])) echo 'checked=checked' ?> > 图文
								</label>
							</div>
						</td>
						<td></td>
					</tr>
					<tr>
						<th class="w100">聚合标签</th>
						<td style="color:#3B4249">
							<div class="btn-group" data-toggle="buttons" >
								<foreach from="$tags" key="$key" value="$val">
								<label class="btn btn-sm <?php if(in_array($val['tid'],$chktag)) echo 'active' ?>" style="background:{$val.bgcolor}">
									<input type="checkbox" name="tag_tid[]" value="{$val.tid}"  <?php if(in_array($val['tid'],$chktag)) echo 'checked=checked' ?> autocomplete="off">{$val.tagname}
								</label>
								</foreach>
							</div>
						</td>
						<td></td>
					</tr>
					<tr>
						<th class="w100">文章关键字</th>
						<td>
							<textarea name="keywords" class="form-control" id="" cols="50" rows="10">{$artContent.keywords}</textarea>
						</td>
						<td></td>
					</tr>
					<tr>
						<th class="w100">文章描述</th>
						<td>
							<textarea name="description" class="form-control" id="" cols="50" rows="10">{$artContent.description}</textarea>
						</td>
						<td></td>
					</tr>
					<tr>
						<th class="w100">文章正文</th>
						<td>
							<textarea name="content" id="ed" cols="20" rows="10">{$artContent.content}</textarea>
							<script>
								var ue = UE.getEditor('ed',{
									initialFrameWidth:700  //初始化编辑器宽度,默认1000
          							,initialFrameHeight:320  //初始化编辑器高度,默认320
								});
							</script>
						</td>
						<td></td>
					</tr>

				</table>
				<div class="position-bottom">
					<input type="submit" class="btn btn-primary" value="添加" />
				</div>
			</form>
		</div>
	</body>

</html>